package com.jch.helloworld.configBeans.factoryBean;

import java.util.HashMap;
import java.util.Map;

/**
 * 静态工厂方法示例
 */
public class StaticFactory {

    private static Map<String,BeanDemo> factory = new HashMap<>();

    static {
        factory.put("sBean0",new BeanDemo("sBean0","this is sBean0","0"));
        factory.put("sBean1",new BeanDemo("sBean1","this is sBean1","1"));
    }

    public static BeanDemo getBeanDemo(String name){
        return factory.get(name);
    }

}
